package com.zxd.dao;

import com.zxd.entity.File;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * ImageDao
 * Created by 涂奕恒 on 2017/10/18 20:00.
 */
public interface FileDao extends JpaRepository<File, Integer>, JpaSpecificationExecutor<File> {

    @Query("select a from File a where a.group.id = ?1 order by a.id desc")
    List<File> findListByGroupId(Integer groupId);

    @Query("select a from File a where a.master.id = ?1")
    List<File> findListByMasterId(Integer masterId);
}